package cn.wolfcode.trip.base.service.impl;


import cn.wolfcode.trip.base.domain.DailyContent;
import cn.wolfcode.trip.base.mapper.DailyContentMapper;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.IDailyContentService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class DailyContentServiceImpl implements IDailyContentService{
    @Autowired
    private DailyContentMapper dailyContentMapper;

    @Override
    public void saveOrUpdate(DailyContent dailyContent) {

        if(dailyContent.getId() == null){

            dailyContentMapper.insert(dailyContent);
        } else {
            dailyContentMapper.updateByPrimaryKey(dailyContent);
        }
    }


 /*   @Override
    public PageInfo query(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize(), qo.getOrderBy());
        List<DailyContent> list = dailyContentMapper.queryForList(qo);
        return new PageInfo(list);
    }*/





}
